'''
import win32com.client as win32
from win32com.client import constants
import os

doc_app = win32.gencache.EnsureDispatch('Word.Application')#打开word应用程序
doc_app.Visible = True
doc = doc_app.Documents.Add()

headerfooter = doc.Sections(1).Headers(constants.wdHeaderFooterPrimary)
shapes = headerfooter.Shapes
#在页眉插入图片
curr_path = os.getcwd()
pic_path = r'%s\IMG_20220123_101725.jpg'%curr_path
shp = shapes.AddPicture(FileName=pic_path,LinkToFile=False,SaveWithDocument=True)
#调节图片的信息
shp.Name = "WordPictureWatermark"#修改shape的名字
shp.PictureFormat.Brightness = 0.85#修改图片的显示亮度
shp.PictureFormat.Contrast = 0.15#修改图片对比度
shp.LockAspectRatio = True #保持图片比例不变
shp.WrapFormat.AllowOverlap = True# 可以与其他图形重叠
shp.WrapFormat.Side = constants.wdWrapNone#不显示边框
shp.WrapFormat.Type = 3 #将形状放在文字前面
## 设置相对与页边距来定位
shp.RelativeHorizontalPosition = constants.wdRelativeVerticalPositionMargin#
shp.RelativeVerticalPosition = constants.wdRelativeVerticalPositionMargin
# 相对于页边距居中（水平和垂直）
shp.Left = constants.wdShapeCenter
shp.Top = constants.wdShapeCenter
'''